
#include"protocol.h"


struct SubPthreadInfo{
    struct sockaddr_in *ClientIP;
    struct epoll_event *EventSum;
    int *accpet_fd;
    int *EpollInstance;

    MessageHeader Msg;
    char Content[RWMaxSize-HeaderSize];
};

ContentList* SelectSqlite(string SSql);

bool InsertSqlite(string SSql);

void* (DeelThread)(void*Data);

class TCP_Server{
    public:
	TCP_Server();
	~TCP_Server();

	void SqlInit();

	void ServerEpoll();


	bool SendMessage(SubPthreadInfo *s,ContentList *p);

    private:
	int socket_fd;
	int accpet_fd[MaxConnet];
	sockaddr_in ServerIP;
	sockaddr_in ClientIP[MaxConnet];
	pthread_t PID[MaxConnet];
	SubPthreadInfo PInfo[MaxConnet];
};


